package com.jaychen.spring.core.ioc;

/**
 * bean 属性注入
 *
 * @Author Jay Chen
 * @Date 2020/11/9 14:42
 */
public class PropertyValue {

    private final String name;
    private final Object value;

    private PropertyValue(String name, Object value) {
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public Object getValue() {
        return value;
    }

    public static PropertyValue.PropertyValueBuilder builder() {
        return new PropertyValue.PropertyValueBuilder();
    }

    public static class PropertyValueBuilder {
        private String name;
        private Object value;

        PropertyValueBuilder() {
        }

        public PropertyValue.PropertyValueBuilder name(final String name) {
            this.name = name;
            return this;
        }

        public PropertyValue.PropertyValueBuilder value(final Object value) {
            this.value = value;
            return this;
        }

        public PropertyValue build() {
            return new PropertyValue(this.name, this.value);
        }
    }
}
